package org.lex.jdbc.url;

import java.util.Collection;

public class CommonObject {

	public static <T extends CommonObject> T getObjectByName(
			Collection<T> objects, String name) {
		T result = null;
		for (T o : objects) {
			if (o.getName().equals(name)) {
				result = o;
				break;
			}
		}
		return result;
	}

	protected String name = "";
	protected String description = "";
	private boolean dynamic = false;

	public String getName() {
		return name;
	}

	public String getDescription() {
		return description;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public boolean isDynamic() {
		return dynamic;
	}

	public void setDynamic(boolean dynamic) {
		this.dynamic = dynamic;
	}

}
